//
//  ThreeViewController.swift
//  testSwift
//
//  Created by taoge on 2018/3/26.
//  Copyright © 2018年 FT. All rights reserved.
//

import UIKit


class ThreeViewController: UIViewController {
   lazy var tableView = FTTableView()
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
     self.view.backgroundColor = UIColor.green
      
        creatUI()
        loadData()
    }
    func creatUI(){
       
         tableView = FTTableView.init(frame: CGRect.init(x: 0, y: 20, width: screenWidth, height: screenHeight), style: .plain)
        self.view.addSubview(tableView)
        tableView.tableFooterView = UIView()
        
        
        let button : UIButton = UIButton(type:.custom)
        button.frame = CGRect.init(x: 10, y: 20, width: 100, height: 100)
        button.backgroundColor = UIColor.cyan
        button .addTarget(self, action: #selector(clickButton), for: UIControlEvents.touchUpInside)
        self.view.addSubview(button)
     }
    func loadData(){
        NetworlTool.loadNewTitleData { (responce) in
            self.tableView.dataArray = responce
            self.tableView.reloadData()
        }
    }
    @objc func clickButton(){
        dismiss(animated: true, completion: nil)
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
